<%@ page language="java" contentType="text/html; charset=UTF-8"   pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=request.getContextPath() %>/ext/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/ext/ext-all.js"></script>

<title>Windfone System --Login</title>
</head>
<body>
Test OK
<a href="<%=request.getContextPath() %>/config-browser/actionNames.action">config broswer</a>
<script>
Ext.require('Ext.form.*');

Ext.onReady(function() {
    Ext.widget('form', {
        renderTo: 'loginForm',
        title: '登陆',
        bodyPadding: 5,
        frame: true,
        width: 340,
//         align : 'center',
        region: 'center',
//         layout: 'fit',
        fieldDefaults: {
            labelAlign: 'left',
            labelWidth: 105,
            anchor: '100%'
        },
        items: [{
                xtype: 'textfield',
                fieldLabel: '用户',
                name: 'name',
                anchor:'95%'
            },{
            	xtype:'textfield',
            	inputType: 'password',
            	fieldLabel: '密码',
            	name: 'password',
            	allowBlank:false,
            	anchor:'95%'
            }],
            buttons: [{
                text: '登陆',
                handler: function() {
                    this.up('form').getForm().doAction('submit',{ 
			             url:'<%=request.getContextPath() %>/employee/loginCheck.action', 
			             method:'post', 
			             params:'', 
			             success:function(form,action){ 
			            	  window.location.href="<%=request.getContextPath() %>/main.action";
			            	 /*
			                 Ext.Msg.alert('更新成功',action.result.info); 
			                 popWindow.close(); 
			                 store.reload(); 
			                 */
			             }, 
			             failure:function(e){ 
			           	  console.info( e); 
			                  Ext.Msg.alert('error','Fail'); 
			             } 
			           }); 
                }
            },{
                text: '重置',
                handler: function() {
                    this.up('form').getForm().reset();
                }
            }]

    });
});


</script>
<div id="loginForm" align="center"></div>
</body>
</html>